From a0b61a5a72a12159d6d61e8f62c3374fd63b462d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 25 Apr 2010 20:58:36 -0400 Subject: [PATCH] Make testellipsize work for rotating non-ellipsized labels --- gtk/gtklabel.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 45522402dd..4590b2682c 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -3450,17 +3450,17 @@ gtk_label_get_desired_size (GtkExtendedLayout *layout, { /* Note, we cant use get_size_for_allocation() when rotating ellipsize labels. */ - if (angle == 90 || angle == 270 || (label->ellipsize && label->have_transform)) + if (!(label->ellipsize && label->have_transform) && (angle == 0 || angle == 180)) { - /* A vertically rotated label does w4h, so return the base desired height (text length) */ - *minimum_size = required_rect.height; - *natural_size = natural_rect.height; + /* Doing a w4h request on a label here, return the required height for the minimum width. */ + get_size_for_allocation (label, GTK_ORIENTATION_HORIZONTAL, + required_rect.width, minimum_size, natural_size); } else { - /* Doing a w4h request on a label here, return the required height for the minimum width. */ - get_size_for_allocation (label, GTK_ORIENTATION_HORIZONTAL, - required_rect.width, minimum_size, natural_size); + /* A vertically rotated label does w4h, so return the base desired height (text length) */ + *minimum_size = required_rect.height; + *natural_size = natural_rect.height; } *minimum_size += label->misc.ypad * 2; *natural_size += label->misc.ypad * 2; -- 2.30.2